/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
// plist.hpp - PegList, PegVertList, and PegHorzList class definitions.
//
// Author: Kenneth G. Maxwell
//
// Copyright (c) 1997-2001 Swell Software, Inc.
//              All Rights Reserved.
//
// Unauthorized redistribution of this source code, in whole or part,
// without the express written permission of Swell Software, Inc.
// is strictly prohibited.
//
// Notes:
//
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/

#ifndef _PEGVLIST_
#define _PEGVLIST_

class PegList : public PegWindow
{
    public:
        PegList(const PegRect &Rect, PEGUINT Id = 0, 
                PEGULONG Style = FF_THIN);
        virtual ~PegList();

        virtual void Add(PegThing *What, PEGBOOL Show = TRUE);
        virtual void AddToEnd(PegThing *What, PEGBOOL Show = TRUE);
        virtual PEGINT Clear();

        virtual PEGINT GetIndex(PegThing *);
        PEGINT GetNumItems(void);
        virtual PegThing *GetSelected(void) {return mpLastSelected;}
        virtual PEGINT GetSelectedIndex(void);
        virtual PegThing *GetThing(PEGINT Index);

        virtual void Insert(PegThing *What, PEGINT Where, PEGBOOL Select=TRUE,
                            PEGBOOL Show = TRUE);
        virtual PEGINT Message(const PegMessage &Mesg);
        PegThing *PageDown(void);
        PegThing *PageUp(void);
        virtual PegThing *Remove(PegThing *What);

        virtual void SetSelected(PegThing *Who);
        virtual PegThing *SetSelected(PEGINT Index);
        PegThing *SelectNext(void);
        PegThing *SelectPrevious(void);
        void SetSeparation(PEGINT Sep) {mChildSeparation = Sep;}

    protected:
        virtual void PositionChildren(void) = 0;
        void ScrollCurrentIntoView();

        PegThing *mpLastSelected;

        PEGINT mChildSeparation;
        PEGBOOL    mNewLast;
};


/*--------------------------------------------------------------------------*/
class PegVertList : public PegList
{
    public:
        PegVertList(const PegRect &Rect, PEGUINT Id = 0,
                    PEGULONG Style = FF_THIN);

    protected:
        virtual void PositionChildren(void);
        
};
/*--------------------------------------------------------------------------*/
class PegHorzList : public PegList
{
    public:
        PegHorzList(const PegRect &Rect, PEGUINT Id = 0,
                    PEGULONG Style = FF_THIN);

    protected:
        virtual void PositionChildren(void);
};

/*--------------------------------------------------------------------------*/


#endif


